package com.ruoyi.merchant.domain.dto;

import lombok.Data;

import javax.validation.constraints.*;
import java.util.List;

/**
 * 商家入驻申请请求
 */
@Data
public class MerchantApplicationRequest {

    @NotBlank(message = "商家名称不能为空")
    @Size(max = 100, message = "商家名称不能超过100字")
    private String merchantName;

    @NotNull(message = "商家类型不能为空")
    @Min(value = 1, message = "商家类型只能是1或2")
    @Max(value = 2, message = "商家类型只能是1或2")
    private Integer merchantType;  // 1=个体工商户，2=企业

    @NotBlank(message = "联系人姓名不能为空")
    @Size(max = 50, message = "联系人姓名不能超过50字")
    private String contactName;

    @NotBlank(message = "联系电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String contactPhone;

    @NotBlank(message = "联系邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String contactEmail;

    @NotBlank(message = "商家地址不能为空")
    @Size(max = 255, message = "地址不能超过255字")
    private String address;

    @Size(max = 200, message = "商家简介不能超过200字")
    private String description;

    @NotBlank(message = "营业执照图片不能为空")
    private String businessLicense;

    @NotBlank(message = "身份证正面图片不能为空")
    private String idCardFront;

    @NotBlank(message = "身份证反面图片不能为空")
    private String idCardBack;

    private List<String> otherCredentials;  // 其他资质证明（多张）

    @NotNull(message = "必须同意协议")
    @AssertTrue(message = "必须同意用户协议")
    private Boolean agreeAgreement;

    private String remark;  // 备注（可选）
}
